# -*- coding: utf-8 -*-
"""
ASNListPage - ASN列表页面 - 只定义元素定位
"""
from playwright.async_api import Page, Locator
from base.page_object import PageElement


class ASNListPage:
    """ASN列表页面 - 只定义元素"""

    def __init__(self, page: Page):
        self.page = page

    # 静态元素定义
    search_button = PageElement(css='button:has-text("搜索")', describe="搜索按钮")
    reset_button = PageElement(css='button:has-text("重置")', describe="重置按钮")
    export_button = PageElement(css='button:has-text("导出")', describe="导出按钮")
    # 在ASNListPage类中添加
    source_no_input = PageElement(css='#sourceNo', describe="来源单号输入框")
    # 动态元素定义 - 通用
    click_input = PageElement(locator_type="role", dynamic=True, describe="点击文本框")
    text_element = PageElement(locator_type="text", dynamic=True, describe="文本元素")
    placeholder_input = PageElement(locator_type="placeholder", dynamic=True, describe="占位符输入框")
    # 下拉框
    blue_white_dropdown = PageElement(locator_type="title", dynamic=True, describe="蓝白下拉框")
    search_dropdown = PageElement(locator_type="text_sear_click", dynamic=True, describe="搜索点击下拉框")
    title_with_div = PageElement(locator_type="title_with_div", dynamic=True, describe="标题带div元素")
    # 查询显示页面
    table_cell = PageElement(locator_type="locator", dynamic=True, describe="查询结果显示")
